﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using Business.Compta;
using DAO.Compta;

namespace Manageo
{
    /// <summary>
    /// Interaction logic for Login.xaml
    /// </summary>
    public partial class Login : UserControl
    {

        public static ObservableCollection<User> Users
        {
            get
            {
                try
                {
                    return new ObservableCollection<User>(ComptaUsersDAO.getAllUsers());
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Problem occured during getting all users\n\n"+ex.Message+" !", "ERROR !!!", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                return new ObservableCollection<User>();
            }
        }

        public Login()
        {
            InitializeComponent();
        }
    }
}
